//
// CInstanceLighter.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CInstanceLighter {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CInstanceLighter(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CInstanceLighter obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CInstanceLighter(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static void lightIgSimple(CInstanceLighter instLighter, CInstanceGroup igIn, CInstanceGroup igOut, SWIGTYPE_p_NL3D__CInstanceLighter__CLightDesc lightDesc, String igName) {
    nel3dJNI.CInstanceLighter_lightIgSimple(CInstanceLighter.getCPtr(instLighter), instLighter, CInstanceGroup.getCPtr(igIn), igIn, CInstanceGroup.getCPtr(igOut), igOut, SWIGTYPE_p_NL3D__CInstanceLighter__CLightDesc.getCPtr(lightDesc), igName);
  }

  public CInstanceLighter() {
    this(nel3dJNI.new_CInstanceLighter(), true);
  }

  public void init() {
    nel3dJNI.CInstanceLighter_init(swigCPtr, this);
  }

  public void light(CInstanceGroup igIn, CInstanceGroup igOut, SWIGTYPE_p_NL3D__CInstanceLighter__CLightDesc lightDesc, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t obstacles, CLandscape landscape, CIGSurfaceLightBuild igSurfaceLightBuild) {
    nel3dJNI.CInstanceLighter_light__SWIG_0(swigCPtr, this, CInstanceGroup.getCPtr(igIn), igIn, CInstanceGroup.getCPtr(igOut), igOut, SWIGTYPE_p_NL3D__CInstanceLighter__CLightDesc.getCPtr(lightDesc), SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(obstacles), CLandscape.getCPtr(landscape), landscape, CIGSurfaceLightBuild.getCPtr(igSurfaceLightBuild), igSurfaceLightBuild);
  }

  public void light(CInstanceGroup igIn, CInstanceGroup igOut, SWIGTYPE_p_NL3D__CInstanceLighter__CLightDesc lightDesc, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t obstacles, CLandscape landscape) {
    nel3dJNI.CInstanceLighter_light__SWIG_1(swigCPtr, this, CInstanceGroup.getCPtr(igIn), igIn, CInstanceGroup.getCPtr(igOut), igOut, SWIGTYPE_p_NL3D__CInstanceLighter__CLightDesc.getCPtr(lightDesc), SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(obstacles), CLandscape.getCPtr(landscape), landscape);
  }

  public void light(CInstanceGroup igIn, CInstanceGroup igOut, SWIGTYPE_p_NL3D__CInstanceLighter__CLightDesc lightDesc, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t obstacles) {
    nel3dJNI.CInstanceLighter_light__SWIG_2(swigCPtr, this, CInstanceGroup.getCPtr(igIn), igIn, CInstanceGroup.getCPtr(igOut), igOut, SWIGTYPE_p_NL3D__CInstanceLighter__CLightDesc.getCPtr(lightDesc), SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(obstacles));
  }

  public static void addTriangles(CLandscape landscape, Vector_uint16 listZone, long order, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t triangleArray) {
    nel3dJNI.CInstanceLighter_addTriangles__SWIG_0(CLandscape.getCPtr(landscape), landscape, Vector_uint16.getCPtr(listZone), listZone, order, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(triangleArray));
  }

  public static void addTriangles(IShape shape, SWIGTYPE_p_NLMISC__CMatrix modelMT, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t triangleArray, int instanceId) {
    nel3dJNI.CInstanceLighter_addTriangles__SWIG_1(IShape.getCPtr(shape), shape, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(modelMT), SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(triangleArray), instanceId);
  }

  public void progress(String message, float progress) {
    nel3dJNI.CInstanceLighter_progress(swigCPtr, this, message, progress);
  }

  public void addStaticPointLight(CPointLightNamed pln, String igName) {
    nel3dJNI.CInstanceLighter_addStaticPointLight(swigCPtr, this, CPointLightNamed.getCPtr(pln), pln, igName);
  }

  public final static int MaxOverSamples = nel3dJNI.CInstanceLighter_MaxOverSamples_get();

}
